import 'package:casdon/modules/login/domain/validators/input_validator.dart';

class EmailValidator implements InputValidator {
  @override
  bool isValude(String input) {
    final emailReg = RegExp(r'^[\w\.-]+@[\w\.-]+\.\w+$');
    return emailReg.hasMatch(input);
  }
  
  @override
  String? validateWithMessage(String input) {
    return isValude(input) ? null : '邮箱不合法';
  }
}